 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-control" content="max-age=0" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Pragma" content="no-cache" />
<title>显示事件内容</title>
<script type="text/javascript" src="easyui/jquery.min.js"></script>
<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js" ></script>
<script type="text/javascript" src="js/loading.js"></script>
<script type="text/javascript" src="js/showEventInfo2.js"></script>
<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="easyui/themes/icon.css" />
<link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" />
<style type="text/css">
<!--
body{
	overflow-y:auto;
}
.atten {
	font-size:12px;font-weight:normal;color:#F00;
}
div.fitem{
	padding-left: 20px;
	padding-top: 10px;
}
div.fitem label{
	width: 50px;
	font-size: 15px;
}
div.fitem input{
	margin-left: 10px;
}
#Monitor,#Director,#username{
	font-weight:bold;
	color:orange;
}
ul{
	list-style-type:none;
	margin: 0 10px 10px 10px;
}
ul li{
	padding:0 10px 0 10px;
	display:inline;
}
ul li a:hover{
	color:red;
}
-->
</style>
</head>

<body class="ContentBody">

<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr >
      <th class="tablestyle_title" >所有事件</th>
  </tr>
  <tr>
  	<td style="background-color:#ccc;line-height:20px;" id="tool">
  		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editStatus()">查看详情信息</a>
     </td>
  </tr>
  <tr>
    <td class="CPanel">
		
		<table border="0" cellpadding="0" cellspacing="0" style="width:100%;">
			
			<tr>
			<td width="100%">
				<!-- 事件内容 -->
			  	<div id="event"></div>
			</td>
		</tr>
		</table>
	 </td>
  </tr>
</table>
</div>

<div id="editStatus" title="发短信给报导人" class="easyui-dialog" modal="true" style="width:870px;height:420px;padding:10px 20px"
            closed="true" buttons="#dlg-buttons">
        <form id="fm" method="post" novalidate>
           	<table border="0" cellpadding="2" cellspacing="1" style="width:100%">
			<tr>
				<td width="10%">与当事人关系</td>
				<td width="15%"><input id="relation" name="RELATION"
						class="easyui-validatebox textbox" style="width: 98%" /></td>
				<td width="10%">报案人姓名</td>
				<td width="15%"><input id="reporterName" name="REPORTERNAME"
						class="easyui-validatebox textbox" style="width: 98%" /></td>
				<td width="10%">报案人电话</td>
				<td width="15%"><input id="reporterPhone" name="REPORTERPHONE"
						class="easyui-validatebox textbox" style="width:98%" /></td>
				<td width="10%">报案人单位</td>
				<td width="15%"><input id="reporterOrganization"
						name="REPORTERORGANIZATION" class="easyui-validatebox textbox"
						style="width: 98%" /></td>
			</tr>
			<tr>
				<td width="10%">报案人住址</td>
				<td width="15%"><input id="reporterAddress"
						name="REPORTERADDRESS" class="easyui-validatebox textbox"
						style="width: 98%" /></td>
				<td width="10%">当事人类型</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="victimType" name="VICTIMETYPE" style="width:98%" /></td>
				<td width="10%">院系</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="stud_academy" name="STUD_ACADEMY" style="width:98%" /></td>
				<td width="10%"><span>班级</span></td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="className" name="CLASSNAME" style="width: 98%" /></td>
			</tr>
			<tr>
				<td width="10%">性别</td>
				<td width="15%"><input class="easyui-validatebox textbox" id="gender"
						name="GENDER" style="width: 98%"/></td>
				<td width="10%">姓名</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="stud_name" name="STUD_NAME" style="width: 98%" /></td>
				<td width="10%">学号</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="stud_id" name="STUD_ID" style="width: 98%" /></td>
				<td width="10%"><span>宿舍号</span></td>
				<td width="15%"><input id="stu_room" name="STU_ROOM"
						class="easyui-validatebox textbox" style="width: 98%; height: 22" />
				</td>
			</tr>
			<tr>
				<td width="10%"><span>联系电话</span></td>
				<td width="15%"><input id="contactPhone" name="CONTACTPHONE"
						class="easyui-validatebox textbox" style="width: 98%" /></td>
				<td width="10%">班主任</td>
				<td width="15%"><input id="classMonitor" name="CLASSMONITOR"
						class="easyui-validatebox textbox" style="width: 98%" /></td>
				<td width="10%">辅导员</td>
				<td width="15%"><input id="classDirector" name="CLASSDIRECTOR"
						class="easyui-validatebox textbox" style="width: 98%"  /></td>
				<td width="10%">辅导员电话</td>
				<td width="15%"><input id="directorPhoneNumber" name="DIRECTORPHONENUMBER"
						class="easyui-validatebox textbox" style="width: 98%"  /></td>
			</tr>
			<tr>
				<td width="10%"><span>工作单位</span></td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="teac_academy" name="TEAC_ACADEMY" style="width: 98%"/>
				</td>
				<td width="10%">报案人姓名</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						type="text" id="reporterTeacherName" name="REPORTERTEACHERNAME"
						style="height: 22; width: 98%" /></td>
				<td width="10%"><span>报案人电话</span></td>
				<td width="15%"><input id="reporterTeacherPhone"
						name="REPORTERTEACHERPHONE" class="easyui-validatebox textbox" style="width: 98%" /></td>
				<td width="10%"><span>联系电话</span></td>
				<td width="15%"><input id="reporterTeacherContactPhone"
						name="REPORTERTEACHERCONTACTPHONE"
						class="easyui-validatebox textbox" 
						style="width: 98%" /></td>
			</tr>
			<tr>
				<td width="10%"><span>宿舍楼</span></td>
				<td width="15%"><input
						id="teac_building" name="TEAC_BUILDING"
						class="easyui-validatebox textbox" style="width: 98%"/>
				</td>
				<td width="10%"><span>房间号</span></td>
				<td width="15%"><input id="teac_room"
						name="TEAC_ROOM" class="easyui-validatebox textbox"
						style="width: 98%" />
				</td>
				<td width="10%"><span>部门领导</span></td>
				<td width="15%"><input
						class="easyui-validatebox textbox" style="width: 98%"
						id="departmentLeader" name="DEPARTMENTLEADER"/></td>
				<td width="10%"><span>领导电话</span></td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="leaderPhoneNumber" name="LEADERPHONENUMBER"
						type="text" style="width: 98%" /></td>
			</tr>
			<tr>
				<td width="10%">案件类型</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="eventType" name="EVENTTYPE" style="width: 98%"/>
				</td>
				<td width="10%">主管部门</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="adminDepartment" name="ADMINDEPARTMENT" style="width: 98%"/>
				</td>
				<td width="10%">主管领导</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="adminDepartmentLeader" name="ADMINDEPARTMENTLEADER"
						style="width: 98%"/></td>
				<td width="10%">主管部门领导电话</td>
				<td width="15%"><input id="adminDepartmentLeaderPhone"
						name="ADMINDEPARTMENTLEADERPHONE"
						class="easyui-validatebox textbox" style="width: 98%; height: 22" />
				</td>
			</tr>
			<tr>
				<td width="10%">协助部门</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="cooperateDepartment" name="COOPERATEDEPARTMENT"
						style="width: 98%" />
				</td>
				<td width="10%">协管领导</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="cooperateDepartmentLeader" name="COOPERATEDEPARTMENTLEADER"
						style="width: 98%" />
				</td>
				<td width="10%">协管部门领导电话</td>
				<td width="15%">
					<input id="cooperateDepartmentLeaderPhone" name="COOPERATEDEPARTMENTLEADERPHONE" class="easyui-validatebox textbox" style="width:98%;height:22" />
				</td>
				<td width="10%">具体经办人</td>
				<td width="15%"><input class="easyui-validatebox textbox"
						id="executor" name="EXECUTOR" style="width: 98%; height: 22" /></td>
			</tr>
			<tr>
				<td width="10%">经办人电话</td>
				<td width="15%"><input id="executorPhone" name="EXECUTORPHONE"
						class="easyui-validatebox textbox" style="width: 98%; height: 22" />
				</td>
				<td width="10%">报案日期</td>
				<td width="15%"><input id="nowDate" name="EVENTDATE"
						class="easyui-validatebox textbox" style="width: 98%; height: 22" />
				</td>
				<td width="10%">案件状态</td>
				<td width="15%"><input id="eventStatus" name="EVENTSTATUS"
						class="easyui-validatebox textbox" style="width: 98%; height: 22" />
				</td>
			</tr>
			<tr>
				<td width="10%">处理方式</td>
				<td width="5%">短信通知</td>
				<td width="5%"><input type="checkbox" id="smsInform"
						name="SMSINFORM" /></td>
				<td width="5%">电话通知</td>
				<td width="5%">
					<input type="checkbox" id="phoneInform"
						name="PHONEINFORM" />
				</td>
			</tr>
			<tr>
				<td width="10%">通知对象</td>
				<td width="5%">具体经办人</td>
				<td width="5%"><input type="checkbox" id="informExecutor"
						name="INFORMEXECUTOR" /></td>
				<td width="5%">主管领导</td>
				<td width="5%"><input type="checkbox"
						id="informAdminDepartmentLeader"
						name="INFORMADMINDEPARTMENTLEADER" /></td>
				<td width="5%">协管领导</td>
				<td width="5%"><input type="checkbox" id="informCooperate"
						name="INFORMCOOPERATE" /></td>
				<td width="5%">辅导员</td>
				<td width="5%"><input type="checkbox" id="informClassDirector"
						name="INFORMCLASSDIRECTOR" /></td>
			</tr>
			<tr>
				<td width="10%">通知对象</td>
				<td width="5%">其它人</td>
				<td width="10%"><input id="informOthers" name="INFORMOTHERS"
						class="easyui-validatebox textbox" style="width: 98%; height: 22" />
				</td>
			</tr>
			<tr>
				<td width="10%"><font color="red">修改理由</font></td>
				<td width="15%">
					<input id="modifyReason" name="MODIFYREASON" class="easyui-textbox" style="width:98%" data-options="prompt:'请先填写理由'">
				</td>
				<td width="10%"><font color="red">修改事件状态</font></td>
				<td width="15%">
					<select id="updateStatus" name="UPDATESTATUS" class="easyui-combobox" style="height:22px">
						<option value="未完成">未完成</option>
						<option value="已完成">已完成</option>
						<option value="延期">延期</option>
					</select>
				</td>
				<td width="10%"><font color="red">修改主管部门</font></td>
				<td width="15%">
					<input id="updateAdminDepartment" name="UPDATEADMINDEPARTMENT" class="easyui-combobox" style="width:98%;height:22px" 
					       data-options="url:'Resource_departmentList',
					                     method:'get',
					                     textField:'DEPARTMENTNAME',
					                     valueField:'DEPARTMENTNAME'" />
					
				</td>
				<td width="10%"><font color="red">修改案件类型</font></td>
				<td width="15%">
					<input class="easyui-combobox" id="updateEventType" name="updateEventType" style="width:98%;height:22px"
							       data-options="url:'json/eventType.json', 
							                     method:'get',
							                     textField:'text',
							                     valueField:'text' "/>
				</td>
			</tr>
			<tr>
				<td width="10%">案件内容</td>
			</tr>
	  </table>
	  <table width="80%" align="center">
		<tr>
				<td nowrap align="center"><textarea id="eventContent"
								name="EVENTCONTENT" id="mainContent" cols="100" rows="15"
								style="background: url('images/icon_1.png') no-repeat bottom right; resize: none;"
								class="easyui-validatebox" >
					</textarea></td>
		</tr>
	</table>
		<input type="hidden" name="EVENTID" id="eventId" />
        </form>
        
        <form id="uploadImage" method="post" enctype="multipart/form-data">
        	<fieldset>
        		<legend>上传图片</legend>
        		<font color="blue">图片列表&gt;&gt;</font>
        		<span id="imageBox">
        		
        		</span>
        		<input type="file" name="file" id="imageFile"/>
        		<span id="uploadImageLoading"></span>
        		<input type="hidden" name="eventId" />
        	</fieldset>
        </form>
        
        <form id="uploadAudio" method="post" enctype="multipart/form-data">
        	<fieldset>
        		<legend>上传录音</legend>
        		<font color="blue">录音列表&gt;&gt;</font>
        		<span id="audioBox">
        		
        		</span>
        		<input type="file" name="file" id="audioFile"/>
        		<span id="uploadAudioLoading"></span>
        		<input type="hidden" name="eventId" />
        	</fieldset>
        </form>
</div>
<!--  width:28%;height:70px;-->
<div id="audioPlayer" title="录音播放" class="easyui-dialog" modal="false" style="width:30%;height:80px;text-aling:center;background-color: black;"
            closed="true">
            <div style="pading:25px;" id="statrAudio"></div>
</div>
<div id="dlg-buttons" style="text-align:center;">
        <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-redo"  style="width:90px" onclick="uploadImage()">上传图片</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo"  style="width:90px" onclick="uploadAudio()">上传录音</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo"  style="width:90px" onclick="printEvent()">打印表格</a>
        <!--  <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo"  style="width:120px" onclick="save()">保存修改理由</a>-->
</div>

<div id="toolbar">
	高级搜索:<input id="heightFind" class="easyui-searchbox" searcher="heightFind" value="" prompt="请输入您想查询的内容" style="width:200px;"/><span style="color:red;">*</span>
</div>
<script type="text/javascript">
	$('#updateStatus').combobox({
		onSelect:function(){
			var operation='修改事件状态';
			var newValue = $(this).combobox('getValue');
			//alert('newValue='+newValue);
			//var oldValue;
			$.ajax({
				url:'Event2_status',
				type:'post',
				data:'eventId='+$('#eventId').val()+'&eventStatus='+$(this).combobox('getValue'),
				beforeSend:function(){
					ajaxLoading("修改中...");
				},
				success:function(data){
					//alert("data="+JSON.stringify(data));
					closeMsg(0);
					if (data.RESULT != 'true') {
						showMsg("修改失败", 0);
						return;
					} else {
						//alert("oldValue="+data.oldValue);
						var oldValue = data.oldValue;
						$.messager.alert("操作提示","<font size=\"4\">修改成功</font>","info",function(){
							$('#event').datagrid('reload'); 
						});
						$('#eventStatus').val($('#updateStatus').combobox('getValue'));
						var reason = $('#modifyReason').textbox('getValue');
						$.ajax({
							url:'EventEdit_EditStatusOp',
							type:'post',
							data:'eventId='+$('#eventId').val()+'&operation='+operation+'&reason='+reason+"&oldValue="+oldValue+"&newValue="+newValue
						});
					}
				}
			});
		}
	});
	
	$("#updateAdminDepartment").combobox({
		onSelect:function(){
			var operation = '修改主管部门';
			var newValue = $(this).combobox('getValue');
			//var oldValue;
			$.ajax({
				url:'Event2_updateAdminDepartment',
				type:'post',
				data:'eventId='+$('#eventId').val()+'&adminDepartment='+$(this).combobox('getValue'),
				beforeSend:function(){
					ajaxLoading("修改中...");
				},
				success:function(data){
					closeMsg(0);
					if (data.RESULT != 'true') {
						showMsg("修改失败", 0);
						return;
					} else {
						var oldValue = data.oldValue;
						$.messager.alert("操作提示","<font size=\"4\">修改成功</font>","info",function(){
							$('#event').datagrid('reload'); 
						});
						$('#adminDepartment').val($("#updateAdminDepartment").combobox('getValue'));
						$('#adminDepartmentLeader').val(data.USERNAME);
						$('#adminDepartmentLeaderPhone').val(data.PHONE);
						var reason = $('#modifyReason').textbox('getValue');
						$.ajax({
							url:'EventEdit_EditAdminDepartmentOp',
							type:'post',
							data:'eventId='+$('#eventId').val()+'&operation='+operation+"&reason="+reason+"&oldValue="+oldValue+"&newValue="+newValue
						});
					}
				}
			});
		}
	});
	
	$("#updateEventType").combobox({
		onSelect:function(){
			var operation = '修改事件类型';
			var newValue = $(this).combobox('getValue');
			//var oldValue;
			$.ajax({
				url:'Event2_updateEventType',
				type:'post',
				data:'eventId='+$('#eventId').val()+'&eventType='+$(this).combobox('getValue'),
				beforeSend:function(){
					ajaxLoading("修改中...");
				},
				success:function(data){
					closeMsg(0);
					if (data.RESULT != 'true') {
						showMsg("修改失败", 0);
						return;
					} else {
						var oldValue = data.oldValue;
						$.messager.alert("操作提示","<font size=\"4\">修改成功</font>","info",function(){
							$('#event').datagrid('reload'); 
						});
						$('#eventType').val($("#updateEventType").combobox('getValue'));
						
						var reason = $('#modifyReason').textbox('getValue');
						$.ajax({
							url:'EventEdit_EditEventTypeOp',
							type:'post',
							data:'eventId='+$('#eventId').val()+'&operation='+operation+"&reason="+reason+"&oldValue="+oldValue+"&newValue="+newValue
						});
					}
				}
			});
			

		}
	});

</script>
</body>
</html>